// SCENARIO SCRIPT

// This is the special script for your entire scenario. It contains
// special encounters and code accessable from anywhere in the scenario. it also
// contains the code that initializes important special things in the
// scenario (like shops and names and descriptions of special items).

// You can create your own states, but you should give all of them numbers greater than
// or equal to 10.

beginscenarioscript;

variables;

body;

beginstate LOAD_SCEN_STATE;
// This is the state that is called every time the scenario is loaded,
// even when a save file in the scenario is loaded. Some things that should go here:
//    Names and descriptions of special items.
//    Names and effects of custom special abilities.

init_special_item(1,"Stone key.","You took this key from a statue underneath the temple. You're under the impression that it will open the way for you to leave the island.");

break;

beginstate START_SCEN_STATE;
// This is the state that is called only once at the very beginning of 
// the scenario. Some things that should go here:
//    The stuff in shops.
//    Creating horses and boats.

create_boat(0,1,29,18,0);

break;

beginstate START_STATE;
// This state is called every tick wherever the party is in the scenario.
// You can use the set_state
break;

// Place your own states below. Give each a number at least 10.

//They've used MM/crystal
beginstate 10;
	if(get_flag(250,0) == 0) {
		reset_dialog();
		add_dialog_str(0,"As the walls tumble around you, the ceiling collapses, raining rubble down onto the floor, and onto you. As you brush the dirt and broken masonry off yourself, you realise that everything is silent.",0);
		add_dialog_str(1,"As the dust finally settles, allowing you to see, you flinch - four angel statues stand around you, snarling, arms outstretched.",0);
		add_dialog_str(2,"Your eyes flit from one to another, and you realise that it worked - they are all looking at each other! They're trapped!",0);
		add_dialog_str(3,"Breathing a sigh of relief, you notice that one of the angels has a stone key on a chain around it's neck. Moving over to it, you pull the key off, and put it in your pack.",0);
		add_dialog_str(4,"The only place on the whole island you have seen with a lock is the guardhouse in the town above. Maybe the key will work for the door there? Either way, there is only way to find out...",0);
		run_dialog(1);
		damage_char(1000,20,4);
		set_flag(250,0,1);
		change_spec_item(1,1);
		set_terrain(9,38,0);
		set_terrain(10,38,0);
		set_terrain(8,39,137);
		set_terrain(10,41,137);
		set_terrain(10,37,137);
		set_terrain(11,38,137);		
		set_terrain(10,39,137);		
		set_terrain(9,40,137);		
	}	
break;



break;
